class Animals {
    public String name;
    public int age;

    public void eat() {
        System.out.println(name+"在吃饭");
    }

    public void sleep() {
        System.out.println(name+"在睡觉");
    }
}

class  Dog extends Animals{

    public void bark() {
        System.out.println(name+"汪汪汪~");
    }
}

class Cat extends Animals {

    public void  mew() {
        System.out.println(name+"喵喵喵~");
    }
}

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "小狗";
        dog.age = 1;
        dog.eat();
        dog.bark();

        Cat cat = new Cat();
        cat.name = "小猫";
        cat.age = 2;
        cat.mew();
        cat.sleep();
    }
}
